﻿using System;
using System.Data;
using MITI;
using System.Drawing;

namespace GPSMap.Core.Misc.DAL
{
    public class Radar
    {
        public PointF center; //Tâm của radar
        public float radius; // Bán kính radar

        protected RectangleF CreateRectangle(float r)
        {
            return new RectangleF(center.X - r, center.Y - r, 2*r, 2*r);
        }

        public void Draw(Graphics g, Color color, string label)
        {
            Pen pen = new Pen(color, 1);

            float r = radius;
            RectangleF rect = new RectangleF(center.X - r, center.Y - r, 2 * r, 2 * r);
            g.DrawEllipse(pen, rect);
            Font myFont = new Font("Times New Roman", 10);
            g.DrawString(label, myFont, Brushes.WhiteSmoke, rect.Right, rect.Bottom);
            pen.Dispose();
        }
    }
}
